﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Resources;
using System.Text;

namespace Mota.EditModule
{
    public static class Resources
    {
        private static ResourceManager resManager;
        static Resources()
        {
            resManager = ResourceManager.CreateFileBasedResourceManager("EditModule", @"..\res\", null);
        }
        public static string GetString(string request)
        {
            try
            {
                return resManager.GetString(request);
            }
            catch 
            {
                return request;
            }
        }
        public static string GetString(string request, params object[] args)
        {
            try
            {
                return String.Format(resManager.GetString(request), args);
            }
            catch
            {
                return String.Format(request, args);
            }
        }
        public static Image GetImage(string imageIdentifier)
        {
            try
            {
                return (Image)resManager.GetObject(imageIdentifier);
            }
            catch 
            {

                return new Bitmap(100,100);
            }
        }
    }
}
